package com.neusoft.resturant.controller;

import com.neusoft.resturant.common.utils.PageResult;
import com.neusoft.resturant.common.utils.R;
import com.neusoft.resturant.entity.ResShop;
import com.neusoft.resturant.entity.ResThumbup;
import com.neusoft.resturant.service.IResShopService;
import com.neusoft.resturant.service.IResThumbupService;
import org.omg.CORBA.INTERNAL;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/thumbup")
public class ResThumbupController extends BaseController{
    @Autowired
    private IResThumbupService resThumbupService;

    /**
     * 查询店铺列表
     */
    @GetMapping("/list")
    public R list(ResThumbup resThumbup)
    {
        resThumbup.setUserId(getCurUser().getUserId());
        List<ResThumbup> list = resThumbupService.selectResThumbupList(resThumbup);
        return R.success(list);
    }

    @GetMapping("/list2")
    public R list2(ResThumbup resThumbup,Integer pageNum,Integer pageSize)
    {
        PageResult list = resThumbupService.selectResThumbupList2(resThumbup,pageNum,pageSize);
        return R.success(list);
    }
}
